﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace G.Service
{
    /// <summary>
    /// EncodingConvert 的摘要说明
    /// </summary>
    public class EncodingConvert : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            var stream = context.Request.InputStream;
            byte[] buffer = new byte[stream.Length];
            stream.Read(buffer, 0, buffer.Length);
            buffer = System.Text.Encoding.Convert(System.Text.Encoding.Default, System.Text.Encoding.UTF8, buffer);
            context.Response.OutputStream.Write(buffer, 0, buffer.Length);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}